package cn.yangliu.jsw;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.tanukisoftware.wrapper.WrapperListener;

/**
 * The type Jsw config.
 *
 * <p>
 * .
 *
 * @author 问道于盲
 */
@Configuration
@EnableConfigurationProperties(JswProperties.class)
@ConditionalOnProperty(prefix = "spring.jsw", name = "enable", havingValue = "true", matchIfMissing = true)
public class JswConfig {

	/**
	 * Jsw helper jsw helper.
	 *
	 * @return the jsw helper
	 */
	@Bean
	@ConditionalOnMissingBean(WrapperListener.class)
	public JswHelper jswHelper(){
		return new JswHelper();
	}

}
